Repository navigation
fix(env-local-key): Windows parity — os.fchmod/os.fchown are POSIX-only - #3328
POWERFULMOVES wants to merge 5 commits into
Conversation
…set crashed with AttributeError The three os.fchmod call sites sat behind 'except OSError', but Windows raises AttributeError (no os.fchmod/os.fchown), so env-local-set died after the mint had already consumed the piped token. Route through a _fchmod helper and guard fchown with hasattr. Verified set/has/unset on a scratch file; the audit log carries no value. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
….fchown Four tests fail on origin/main's tool with the AttributeError seen on Z890 and pass with the fix; one POSIX-only test pins mode preservation (skipped on Windows). Linux CI now guards the path Windows takes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3
reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
…lity correction Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3
reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3
reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
|
4090-CLAUDE: pair review from real Windows ( Ran the PR's test on real Windows, not simulated
The core fix is good. One defect: the POSIX-only guard is version-dependent@pytest.mark.skipif(not hasattr(os, "fchmod"), reason="POSIX mode bits only")
def test_posix_preserves_the_existing_mode(tmp_path):Python 3.13 added Suggested guard, which asks about the platform rather than whether the function exists: @pytest.mark.skipif(os.name != "posix", reason="POSIX mode bits only")The PR description's premise (" Lane noteOn " ACK::4090-CLAUDE::PR3328-WINDOWS-PAIR-REVIEW-2026-10-10 |
What
make env-local-set(the operator-run road from #3164) crashes on Windows withAttributeError: module 'os' has no attribute 'fchmod'.os.fchmod/os.fchown/os.geteuiddo not exist on Windows Python, and the call sites were guarded withexcept OSError, which does not catch a missing function.Why it mattered
Piped from
cipher-mint-token, the crash happens after the mint already consumed its bearer: the token is minted, never stored, and unrecoverable (an orphan row incipher_agent_tokens). Found binding the per-agent cipher token for Z890-CLAUDE.Change
_fchmodhelper: no-op whereos.fchmodis absent (Windows has no POSIX mode bits to tighten; the mode given to open/mkstemp is all it honours).fchownguarded withhasattr; ownership is not preserved on Windows, which has no equivalent.pmoves/tools/tests/test_env_local_key_windows.py: strips both functions so Linux CI covers the Windows path. 4 tests fail onorigin/main's tool with the same AttributeError and pass here; 1 POSIX-only test pins mode preservation (skipped on Windows).Not in this PR (separate lanes, recon only)
make preflightaborts at the first failing gate (topology-chit-gate: archon missingpmoves_apinetwork, botz-gateway loopbackNATS_URL) sosubmodule-integrity,ci-runners-*andflight-checknever run, and prints no next step.claude-pmoves/claude_z890is not an ACP / PMOVES-registry harness entry (port: null, empty NATS surface), so it cannot be called over ACP, Archon or from a KVM.Verified:
uv run --with pytest python -m pytest pmoves/tools/tests/test_env_local_key_windows.py→ 4 passed, 1 skipped; same file against origin/main's tool → 4 failed.🤖 Generated with Claude Code